// 请假信息
import request from "@/config/request"

interface UpdateApplicationStatusParams {
    id: string | number;
    status: string | number;
}

// 获取申请列表
export const getLeaveList = (type: number) => {
    return request.get(`/admin/leave/list?type=${type}`)
}

// 获取申请详情
export const getLeaveDetail = (id: number) => {
    return request.get(`/admin/leave/get?id=${id}`)
}

// 修改审核状态
export const updateLeaveStatus = (params: UpdateApplicationStatusParams) => {
    return request.post(`/admin/leave/update`, {}, {
        params: params
    })
}

// 删除申请列表
export const deleteLeave = (id: number) => {
    return request.post(`/admin/leave/delete?id=${id}`)
}